## -*- coding: utf-8 -*-
<%inherit file="blog_base.html"/>

<%def name="ad_part1(blog)">
	<div class="ad">
	%if not smartphone:
	<script type="text/javascript"><!--
	google_ad_client = "pub-2844008643002681";
	/* 728x90, 作成済み 10/12/14 */
	google_ad_slot = "5552589513";
	google_ad_width = 728;
	google_ad_height = 90;
	//-->
	</script>
	<script type="text/javascript"
	src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
	</script>
	% endif
	</div>
</%def>

<%def name="entry_header(entry)">
	<header>
		<div class="entrytitle">
		<h2><a href="${entry.get_path()}">${entry.title}</a></h2>
		</div>
		<div class="entryinfo">
			<div class="inner">
			<ul>
			<li style="vertical-align:top;">
			${_('Posted by :')}
			ats
			${_('at :')}
			<time datetime="${helpers.format_date(entry.created_at, 'html5')}" pubdate>
			${helpers.format_date(entry.created_at, 'long')}
			</time>
			</li>
			<% cats=entry.get_category_objects();
			%>
			% if cats:
			<li style="vertical-align:top;">
			${_('Tag(s)')}:
			%for c in cats:
			${c.title}
			%endfor
			</li>
			% endif
			<li style="vertical-align:top;">
			<a href="http://b.hatena.ne.jp/entry/http://coreblog.org${entry.get_path()}" class="hatena-bookmark-button" data-hatena-bookmark-layout="standard" title="このエントリーをはてなブックマークに追加">
			<img src="http://b.st-hatena.com/images/entry-button/button-only.gif" alt="このエントリーをはてなブックマークに追加" width="20" height="20" style="border: none;" />
			</a>
			</li>
			% if entry==content:
			<li>
			<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-via="ats">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
			</li>
			<li>
				<a href="http://www.tumblr.com/share" title="Share on Tumblr" style="display:inline-block; text-indent:-9999px; overflow:hidden; width:81px; height:20px; background:url('http://platform.tumblr.com/v1/share_1.png') top left no-repeat transparent;">Share on Tumblr</a>
			</li>
			<li>
				<g:plusone size="medium"></g:plusone>
			</li>
			<li>
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fcoreblog.org${entry.get_path().replace('/', '%2F')}&amp;layout=standard&amp;show_faces=false&amp;width=450&amp;action=like&amp;font=segoe+ui&amp;colorscheme=light&amp;height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:35px;" allowTransparency="true"></iframe>
			</li>
			% endif
			</ul>
			</div>
		</div>
	%if smartphone:
<script type="text/javascript"><!--
  // XHTML should not attempt to parse these strings, declare them CDATA.
  /* <![CDATA[ */
  window.googleAfmcRequest = {
    client: 'ca-mb-pub-2844008643002681',
    format: '320x50_mb',
    output: 'html',
    slotname: '9560066105',
  };
  /* ]]> */
//--></script>
<script type="text/javascript"    src="http://pagead2.googlesyndication.com/pagead/show_afmc_ads.js"></script>
	% endif
	</header>
</%def>

<%def name="entry_body(entry)">
<article>
	${self.entry_header(entry)}
	
	<section class="entrybody">
	%if entry==content:
	<nav class="nextprev">
		<%
			prev=entry.get_previous()
			next=entry.get_next()
		%>
		<ul>
			%if next:
			<li><a href="${next.get_path()}" class="button"><span class="magnifier icon uparrow"></span>${next.title}</a></li>
			%endif
			%if prev:
			<li><a href="${prev.get_path()}" class="button"><span class="magnifier icon downarrow"></span>${prev.title}</a></li>
			<br />
			%endif
		</ul>
	</nav>
	%endif
	${entry.body}
	%if entry.extend_body:
	${entry.extend_body}
	%endif
	</section>

	%if entry==content and not smartphone:
	<div class="ad">
		<script type="text/javascript"><!--
		google_ad_client = "ca-pub-2844008643002681";
		/* ad2 */
		google_ad_slot = "6841803577";
		google_ad_width = 468;
		google_ad_height = 60;
		//-->
		</script>
		<script type="text/javascript"
		src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
		</script>
	</div>
	%endif

	${self. entry_comments(entry)}

</article>
</%def>

<%def name="entry_comments(entry)">
	%if entry.comment_count:
		% for n, c in enumerate(entry.get_comments(order='created_at')):
		% if n==0:
		<section class="comments">
		<h2>${_('Comments')}</h2>
		% endif:

		<div class="comment">
		% if c.url and 'profile_image' in c.url:
		<div class="icon">
			<img src="c.url">
		</div>
		% endif
		<h3>${c.title}</h3>
		<ul>
		<li>
		${_('Posted by :')}
		<a href="http://twitter.com/${c.author_name}" target="_blank" >${c.author_name}</a>
		${_('at :')}
		${helpers.format_date(c.created_at, 'long')}
		</li>
		</ul>
		<p>
		${c.body}
		</p>
		</div>

		% if n==0:
		</section>
		% endif:

		% endfor:
	% endif:


	%if content==entry:
	<section class="tweetreferer">
	<script type="text/javascript" src="/js/search_tweet.js" charset="utf-8"></script>
	<div id="topsy-tweet-search-results" class="referertweet"></div>
	</section>
	%endif

	%if content==entry and entry.accept_comment<=1:
	<section class="commentform">
		${get_comment_form().render(translate=translate)|n}
	</section>
	%endif
</%def>

<%def name="column_one()">
${entry_body(content)}
</%def>

